<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');

class CarInfo_m extends MY_Model
{

    const TBL = 'car_info';

    function __construct()
    {
        parent::__construct();
    }

    public function get_push_users($car_seat){
        $this->db->select('car_info.user_id,apns.device_token');
        $this->db->from('car_info');
        $this->db->join('apns', 'car_info.user_id = apns.user_id', 'left');
        $this->db->join('car_seat', 'car_info.car_seat = car_seat.id', 'left');
        $this->db->where('car_seat.car_seat >=', $car_seat);
        $this->db->where('apns.deleted', 0);
        $query = $this->db->get();
        if ($query->num_rows() > 0) {
            return $query->result_array();
        }
    }
}
